package com.wise.service.cms.content.resourcegroup;

import com.wise.entities.content.ResourceGroup;
import com.wise.entities.content.ResourceStatus;
import com.wise.framework.daomodel.DaoOne4Update;
import com.wise.framework.daomodel.DaoSave;
import com.wise.framework.logger.Logger;
import com.wise.summer.v1.cms.content.resourcegroup.DeleteResourceGroupById;
import org.springframework.stereotype.Service;
import org.summerframework.model.SummerService;
import org.summerframework.model.SummerServiceBean;

import static com.wise.model.content.ContentErrMsgs.Err_100100000004;


/**
 * @author yubo
 */
@Service
@SummerService
public class DeleteResourceGroupsService implements SummerServiceBean<DeleteResourceGroupById> {
    private static final Logger log = Logger.getLogger(DeleteResourceGroupsService.class);

    @Override
    public void sum(DeleteResourceGroupById summer) {
        ResourceGroup resourceGroups = DaoOne4Update.s(ResourceGroup.class, summer.getId(), Err_100100000004);

        //物理删除

        //逻辑删除
        resourceGroups.setStatus(ResourceStatus.Delete.value());
        DaoSave.s(resourceGroups);

        summer.setSummerResult(true);
    }
}
